From: Julian Sparber Date: Mon, 12 Feb 2024 12:07:37 +0000 (+0100) Subject: messageTray: Drop NotificationBanner X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~281^2~1^2~22 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=940b658071047fab8d1db18f301c59095b384f79;p=gnome-shell.git messageTray: Drop NotificationBanner We want to have the same widget used to display the notification in the calendar popover as in the messageTray, so let's actually use the same widget. Part-of: --- diff --git a/js/ui/messageTray.js b/js/ui/messageTray.js index 823b7b9ab..a8732e6e0 100644 --- a/js/ui/messageTray.js +++ b/js/ui/messageTray.js @@ -575,27 +575,6 @@ export const Notification = GObject.registerClass({ }); SignalTracker.registerDestroyableType(Notification); -export const NotificationBanner = GObject.registerClass({ - Signals: { - 'done-displaying': {}, - }, -}, class NotificationBanner extends Calendar.NotificationMessage { - _init(notification) { - super._init(notification); - - this.can_focus = false; - this.add_style_class_name('notification-banner'); - - this.notification.connectObject('activated', () => { - // We hide all types of notifications once the user clicks on - // them because the common outcome of clicking should be the - // relevant window being brought forward and the user's - // attention switching to the window. - this.emit('done-displaying'); - }, this); - } -}); - export const Source = GObject.registerClass({ Properties: { 'count': GObject.ParamSpec.int( @@ -931,6 +910,7 @@ export const MessageTray = GObject.registerClass({ this._notificationRemoved = true; if (this._notificationState === State.SHOWN || this._notificationState === State.SHOWING) { + this._pointerInNotification = false; this._updateNotificationTimeout(0); this._updateState(); } @@ -1059,12 +1039,6 @@ export const MessageTray = GObject.registerClass({ return GLib.SOURCE_REMOVE; } - _escapeTray() { - this._pointerInNotification = false; - this._updateNotificationTimeout(0); - this._updateState(); - } - // All of the logic for what happens when occurs here; the various // event handlers merely update variables such as // 'this._pointerInNotification', 'this._traySummoned', etc, and @@ -1147,8 +1121,9 @@ export const MessageTray = GObject.registerClass({ this.idleMonitor.add_user_active_watch(this._onIdleMonitorBecameActive.bind(this)); } - this._banner = new NotificationBanner(this._notification); - this._banner.connectObject('done-displaying', this._escapeTray.bind(this), this); + this._banner = new Calendar.NotificationMessage(this._notification); + this._banner.can_focus = false; + this._banner.add_style_class_name('notification-banner'); this._bannerBin.add_child(this._banner);